﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace Chizx.Web.systemlog
{
    public partial class Show : Page
    {        
        		public string strid=""; 
		protected void Page_Load(object sender, EventArgs e)
                {
                    if (null == Session["UserEntity"])
                    {
                        Response.Redirect("/e/Login.aspx");
                    }
			if (!Page.IsPostBack)
			{
				int zl_id = -1;
				if (Request.Params["id0"] != null && Request.Params["id0"].Trim() != "")
				{
					zl_id=(Convert.ToInt32(Request.Params["id0"]));
				}
				string zu_id = "";
				if (Request.Params["id1"] != null && Request.Params["id1"].Trim() != "")
				{
					zu_id= Request.Params["id1"];
				}
				ShowInfo(zl_id,zu_id);
			}
		}
		
	private void ShowInfo(int zl_id,string zu_id)
	{
		Chizx.BLL.SystemLogBll bll=new Chizx.BLL.SystemLogBll();
		Chizx.Model.SystemLogModel model=bll.GetModel(zl_id,zu_id);
		this.lblzl_id.Text=model.zl_id.ToString();
		this.lblzu_id.Text=model.zu_id;
		this.lblzl_dowhat.Text=model.zl_dowhat;
		this.lblzl_dotype.Text=model.zl_dowhen.ToString().Contains("0") ? "Test" : (model.zl_dowhen.ToString().Contains("1") ? "Auth" : (model.zl_dowhen.ToString().Contains("2") ? "Read" : (model.zl_dowhen.ToString().Contains("3") ? "Write" : (model.zl_dowhen.ToString().Contains("4") ? "Del" : "Impor"))));
		this.lblzl_dowhen.Text=model.zl_dowhen.ToString();
		this.lblzl_dodesc.Text=model.zl_dodesc;
        //写入系统日志
        if (Session["UserEntity"] == null)
        {
            Response.Redirect("/e/Login.aspx");
        }
        else
        {
            Chizx.Model.UserModel sbmmodel = (Chizx.Model.UserModel)Session["UserEntity"];
            Chizx.BLL.SystemLogBll sbll = new Chizx.BLL.SystemLogBll();
            Chizx.Model.SystemLogModel slm = new Chizx.Model.SystemLogModel();
            slm.zu_id = sbmmodel.zu_id;
            slm.zl_dowhen = DateTime.Now;
            slm.zl_dowhat = "查看详细系统日志信息";
            slm.zl_dotype = "2";//0:Test,1:Auth,2:Read,3:Write,4:Del,5:Inpor
            slm.zl_dodesc = "操作成功";
            sbll.Add(slm);
        }

	}


    }
}
